$(function () {
    $("#yypf_ht_id").combogrid({
        panelWidth: 640,
        delay: 500,
        mode: 'remote',
        idField: 'id',
        textField: 'htbm',
        fitColumns: true,
        pagination: true,//是否分页
        collapsible: false,//是否可折叠的
        fit: true,//自动大小
        pageSize: 10,//每页显示的记录条数，默认为10
        url: $.webPath() + '/zjgl/yypf/xlhtList',
        columns: [[
            {field: 'id', hidden: true},
            {field: 'htbm', title: '合同号', width: 100, align: 'center'},
            {field: 'hzf_qc', title: '合作方', width: 120, align: 'center'},
            {field: 'yfje', title: '已付金额', width: 70, align: 'center'},
            {field: 'jhdd', title: '交货地点', width: 80, align: 'center'},
            {field: 'qdrq', title: '签订日期', width: 80, align: 'center'},

        ]],
        onSelect: function () {
            var g = $('#yypf_ht_id').combogrid('grid');	// 获取数据表格对象
            var r = g.datagrid('getSelected');	// 获取选择的行
            $.post($.webPath() + '/organ/gsjg/findXyKhByHtId_qclist', {htId:r.id}, function (data) {
                $("#yypf_kh_id").val(data[0].qc);
            });
        },
        onLoadSuccess: function () {
            if (yypfOperType) {
                $('#yypf_ht_id').combo('readonly');
            }
        }
    });
});